package Message.Public
{
    import Framework.MQ.*;
    import Framework.Serialize.*;

    public class SStallBuy extends Object implements IMessageBase
    {
        public var buyEntityId:SEntityId;
        public var buyPlayerName:String;
        public var stallEntityId:SEntityId;
        public var stallPlayerName:String;
        public var uid:String;
        public var itemCode:int;
        public var itemName:String;
        public var amount:int;
        public var coin:int;
        public var gold:int;
        public var result:Boolean;
        public var playerItems:Array;
        public const _type:int = 20303;
        public static var _regist:SStallBuy = new SStallBuy(true);

        public function SStallBuy(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            
        }

        public function getType() : int
        {
            return this._type;
        }

        public function clone() : IMessageBase
        {
            return new SStallBuy();
        }

        public function __write(param1:SerializeStream) : void
        {
            this.buyEntityId.__write(param1);
            param1.writeString(this.buyPlayerName);
            this.stallEntityId.__write(param1);
            param1.writeString(this.stallPlayerName);
            param1.writeString(this.uid);
            param1.writeInt(this.itemCode);
            param1.writeString(this.itemName);
            param1.writeInt(this.amount);
            param1.writeInt(this.coin);
            param1.writeInt(this.gold);
            param1.writeBool(this.result);
            SeqPlayerItemHelper.write(param1, this.playerItems);
            
        }

        public function __read(param1:SerializeStream) : void
        {
            this.buyEntityId = new SEntityId();
            this.buyEntityId.__read(param1);
            this.buyPlayerName = param1.readString();
            this.stallEntityId = new SEntityId();
            this.stallEntityId.__read(param1);
            this.stallPlayerName = param1.readString();
            this.uid = param1.readString();
            this.itemCode = param1.readInt();
            this.itemName = param1.readString();
            this.amount = param1.readInt();
            this.coin = param1.readInt();
            this.gold = param1.readInt();
            this.result = param1.readBool();
            this.playerItems = SeqPlayerItemHelper.read(param1);
            
        }

    }
}
